app.controller('SigninFormController',[
    '$scope','notification','oauthService','$state',
    function($scope,notification,oauthService,$state){
        $scope.form={};

        $scope.submit=function() {
            oauthService.getUserTokenAsync($scope.form.userName,$scope.form.password)
                .then(function(result){
                    if(result.success){
                        $state.go('app.dashboard');
                    }else{
                        notification.error(result.error);
                    }
                });
        };
    }
]);